package com.bm.server.controller;


import com.bm.common.dto.LoversDto;
import com.bm.common.vo.R;
import com.bm.server.entity.Lovers;
import com.bm.server.service.intf.LoversService;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/server/lovers")

public class LoversController {
    @Resource
    private LoversService service;
    @GetMapping("/all.do")
    public R selectAll(){
        List<Lovers> loversIds = service.findLoversIds();
        ArrayList<LoversDto> loversInfo = service.findLoversInfo(loversIds);

        return R.ok(loversInfo);
    }

}
